import request from '../utils/request';

let base = '/api';

//传送json格式的post请求
export const postRequest = (url, params) => {
    return request({
        method: 'post',
        url: `${base}${url}`,
        data: params,
        contentType: 'application/json;charset=utf-8'
    })
};

//传送参数的put请求
export const putRequest = (url, params)=>{
    return request({
        method: 'put',
        url: `${base}${url}`,
        data: params
    })
};

//传送参数的delete请求
export const deleteRequest = (url, params)=>{
    return request({
        method: 'delete',
        url: `${base}${url}`,
        data: params
    })
};

//传送参数的get请求
export const getRequest = (url, params)=>{
    return request.get(`${base}${url}`,{
        params: params
    })
};
